﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Netfraction.DataTransfer
{
    public class TransferFileNode : TransferNode
    {
        public TransferFileNode(TransferNode parent, string name, string localPath, long size, string rootHash)
            : base(parent, name, localPath)
        {
            this.Size = size;
            this.RootHash = rootHash;
            this._completedBytes = 0;
        }

        public TransferFileNode(TransferNode parent, string name, string localPath, long size, long completedBytes, string rootHash)
            : base(parent, name, localPath)
        {
            this.Size = size;
            this.RootHash = rootHash;
            this._completedBytes = completedBytes;
        }

        public long Size { get; set; }
        public string RootHash { get; set; }
        private long _completedBytes;

        public double Progress
        {
            get { return (_completedBytes / this.Size); }
        }
    }
}
